#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：turbo 
@File    ：whitelist.py
@Author  ：赵加响
@Date    ：2025/11/7 10:19 
@Desc    ：
"""
from django.conf import settings


class WhiteListRegistry:
    def __init__(self):
        self._white_list = []

        if hasattr(settings, 'URL_WHITE_LIST'):
            self.register(settings.URL_WHITE_LIST)

    def register(self, items):
        if isinstance(items, list):
            self._white_list.extend(items)
        else:
            self._white_list.append(items)

    @property
    def white_list(self):
        return list(set(self._white_list))


white_list_registry = WhiteListRegistry()
